﻿<Window x:Class="StackHash.AddPlugin"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vcs="clr-namespace:StackHash.ValueConverters"
        Title="Add Plugin - StackHash" Width="500" MinWidth="500" Height="300" MinHeight="300" Icon="/StackHash;component/StackHash.ico" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" Closed="Window_Closed">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="MasterResources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="Help" x:Name="commandBindingHelp" Executed="commandBindingHelp_Executed" />
    </Window.CommandBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Label Margin="7" Target="{Binding ElementName=comboBoxPlugin}">_Plugin:</Label>
        <ComboBox Grid.Column="1" Margin="0,10,10,10" Name="comboBoxPlugin" ItemsSource="{Binding AvailablePlugins}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedPlugin}" SelectionChanged="comboBoxPlugin_SelectionChanged"></ComboBox>
        
        <Label Margin="7,0,7,7" Grid.Row="1">Sets Plugin Reference:</Label>
        <TextBlock Margin="0,5,10,10" Grid.Row="1" Grid.Column="1" Text="{Binding ElementName=comboBoxPlugin, Path=SelectedItem.PlugInSetsBugReference, Converter={StaticResource boolToYesNoConverter}}" />

        <Label Margin="7,0,7,7" Grid.Row="2" Target="{Binding ElementName=textBoxDescription}">_Description:</Label>
        <TextBox Margin="0,0,10,10" Grid.Row="2" Grid.Column="1" Name="textBoxDescription" Text="{Binding ElementName=comboBoxPlugin, Path=SelectedItem.PlugInDescription}" IsReadOnly="True" IsReadOnlyCaretVisible="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Visible" TextWrapping="Wrap" />
        
        <TextBlock Margin="0,0,10,10" Grid.Row="3" Grid.Column="1"><Hyperlink Name="hyperlinkPluginHelp" Click="hyperlinkPluginHelp_Click" ToolTip="{Binding ElementName=comboBoxPlugin, Path=SelectedItem.HelpUrl}">More information about this plugin</Hyperlink></TextBlock>

        <Border Grid.Row="4" Grid.ColumnSpan="2" Style="{StaticResource ButtonBorder}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                
                <Button Margin="10" Command="Help">Help</Button>

                <StackPanel Grid.Column="1" Margin="7" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Margin="3" IsDefault="True" Name="buttonOK" Click="buttonOK_Click">OK</Button>
                    <Button Margin="3" IsCancel="True">Cancel</Button>
                </StackPanel>
                
            </Grid> 
        </Border>

    </Grid>
</Window>
